import { axios } from "../../utils/request";

const api = {
  PageList: "/crm/customer/page",   //客户管理、联系人管理、联系记录管理动态查询
  save: "/crm/business/save",
  disable: "/crm/business/disable",
  enable: "/crm/business/enable",
  delete: "/crm/business/delete",
  detail:"/crm/business/detail",     // 详情
  saleFunnelStatistic:"/crm/business/saleFunnelStatistic",     // 销售统计
  listNoDistributeCrmBusiness:"/crm/business/listNoDistributeCrmBusiness",  //获取 没有关联 活动非 商机
  listActivityBusiness:"/crm/business/listActivityBusiness",  //获取市场活动关联的商机
};

/**
 * 动态条件查询
 * @param {*} data
 */
export function PageList(data) {
  return axios({
    url: api.PageList,
    method: "post",
    data: data
  });
}

/**
 * 保存
 */
export function save(parameter) {
  return axios({
    url: api.save,
    method: "post",
    data: parameter
  });
}

/**
 * 停用
 */
export function disable(parameter) {
  return axios({
    url: api.disable,
    method: "post",
    data: parameter
  });
}

/**
 * 启用
 */
export function enable(parameter) {
  return axios({
    url: api.enable,
    method: "get",
    params: parameter
  });
}

/**
 * 删除
 */
export function deleteBusiness(parameter) {
  return axios({
    url: api.delete,
    method: "get",
    params: parameter
  });
}

/**
 * 详情
 */
export function detail(data) {
  return axios({
    url: api.detail,
    method: "get",
    params: data
  });
}

/**
 * 销售统计 
 * @param {*} data 
 */
export function saleFunnelStatistic(data) {
  return axios({
    url: api.saleFunnelStatistic,
    method: "post",
    data: data
  });
}

/**
 * * 获取 没有关联 活动非 商机
 * @param {*} parameter 
 */
export function listNoDistributeCrmBusiness(parameter) {
  return axios({
    url: api.listNoDistributeCrmBusiness,
    method: "get",
    params: parameter
  });
}

/**
 * * 获取市场活动关联的商机
 * @param {*} parameter 
 */
export function listActivityBusiness(parameter) {
  return axios({
    url: api.listActivityBusiness,
    method: "get",
    params: parameter
  });
}


